Skip to content

fix: Harden source-mode popups, providers, and persistence safeguards#21

Merged
mhiro2 merged 6 commits intomainfrom
fix/source-keymaps-layout-safety-grep-marks-cleanup
Mar 8, 2026
Merged

fix: Harden source-mode popups, providers, and persistence safeguards#21
mhiro2 merged 6 commits intomainfrom
fix/source-keymaps-layout-safety-grep-marks-cleanup

Conversation

@mhiro2
Copy link
Copy Markdown
Owner

@mhiro2 mhiro2 commented Mar 8, 2026

Summary

  • Harden source-mode popup keymaps so focused popups keep working without clobbering existing buffer-local mappings.
  • Tighten provider and config behavior by bounding ripgrep searches, rejecting invalid file targets, and removing unused marks config.
  • Improve setup and persistence resilience by stopping stale cleanup timers and warning on invalid persisted session data.

Changes

  • f539414 : fix(ui): apply popup keymaps to source mode and harden nvim_win_set_config
    • Makes source-mode popup mappings follow the focused popup so shared buffers do not lose their original buffer-local mappings on leave or close.
    • Keeps popup and stack-view window reconfiguration tolerant of nvim_win_set_config failures.
    • Expands source-mode coverage for keymap restoration and multiple popups sharing the same buffer.
  • d4c57c6 : fix(providers): add -- separator and --max-count to rg command
    • Prevents ripgrep queries from being parsed as flags and caps search results to avoid runaway result sets.
  • 444445e : fix(config): remove unused providers.marks.scope option
    • Removes an unused marks-provider option from defaults, validation, types, and documentation so the config surface matches the implementation.
  • 16d7eff : fix(providers): reject missing files and directories in file provider
    • Stops file-provider jumps from returning invalid locations for missing paths or directories.
    • Adds coverage for missing, directory, and valid file targets.
  • 92b2c4b : fix(core): stop cleanup timer before re-setup to prevent timer leak
    • Stops the existing cleanup timer before re-running setup so disabling auto-close does not leave stale timers behind.
    • Adds a regression test for repeated setup with auto-close toggled off.
  • 43373fc : fix(persist): warn on session data decode failure instead of silent fallback
    • Surfaces invalid session store payloads with warnings while still falling back to empty data.
    • Covers both async and sync read paths so corrupted JSON is visible in tests.

mhiro2 added 6 commits March 8, 2026 22:54
…onfig

Source mode popups now receive the same keymaps as copy mode (close,
focus, promote, zoom, stack view, window nav). Keymaps are tracked
and removed on popup close to prevent leaking into normal editing.
This also makes confirm_on_close reachable for source mode.

Wrap nvim_win_set_config in pcall in layout.reflow() and
stack_view.resize_all() to match update_focus_zindex() safety,
preventing WinClosed/WinResized race crashes.
Prevents dash-prefixed queries from being interpreted as rg options
and caps results at 1000 to avoid unbounded output on large matches.
The marks provider exposes separate buffer/global/all entry points,
making the scope config field redundant. Remove it from defaults,
validation, types, docs, and tests to avoid misleading users.
Add fs_stat check before creating a location in file.under_cursor
so non-existent paths and directories are filtered out instead of
producing invalid popups.
Call cleanup.stop() unconditionally before checking auto_close config
in events.setup(), so re-setup with auto_close disabled properly
clears the previous timer.
…allback

Add path-prefixed warning when JSON decode fails in store.read and
store.read_sync, so users can identify corrupted session files
instead of seeing sessions silently disappear.
@mhiro2 mhiro2 self-assigned this Mar 8, 2026
@mhiro2 mhiro2 added the bug Something isn't working label Mar 8, 2026
@mhiro2 mhiro2 merged commit c73aac6 into main Mar 8, 2026
3 checks passed
@mhiro2 mhiro2 deleted the fix/source-keymaps-layout-safety-grep-marks-cleanup branch March 8, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant